Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds config option for including static objects during navmesh construction #2104

Conversation

mukulkhanna
Copy link
Contributor

Motivation and Context

HSSD scenes have all scene objects initialized as static ones. Anyone who needs to use these scenes for training agents (using hab-lab) needs to either manually turn on this inclusion of static objects for navmesh construction (and rebuild) or make an explicit recompute_navmesh call with this flag turned on.

This PR adds a config option to toggle this inclusion. Corresponding hab-lab PR coming soon.

How Has This Been Tested

By visualizing topdown maps with this flag ON and OFF.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 11, 2023
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.
You'll need to add this bool to the comparator in SimulatorConfiguration.cpp also.

@mukulkhanna
Copy link
Contributor Author

@aclegg3, I have made the suggested changes and have also opened a corresponding hab-lab PR here:

facebookresearch/habitat-lab#1337

@@ -54,6 +54,10 @@ void initSimBindings(py::module& m) {
.def_readwrite(
"allow_sliding", &SimulatorConfiguration::allowSliding,
R"(Whether or not the agent can slide on NavMesh collisions.)")
.def_readwrite(
"include_static_objects_in_navmesh",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure there is a good reason, but why isn't this a navmesh setting? It requires a reconstruction of the Navmesh which we check by seeing if the new navmesh settings equals the old. Feels more naturally to live in there, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
Currently, NavMeshSettings only includes recast-level parameters. The mesh joining triggered by this flag happens before the nav module is ever invoked, so it is really a Simaultor flag at the scene level.

I think there could be a valid argument to add this to the NavMeshSettings and then pivot off of that in recompute_navmesh directly instead of treating it separately. That would be a breaking change across the stack.

self.recompute_navmesh(self.pathfinder, needed_settings)
self.recompute_navmesh(
self.pathfinder,
needed_settings,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So weird that this isn't in the navmesh setting struct...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, don't we need to change the if statement above this to always recompute the navmesh if include_static_objects=True, since we can't guarantee that the navmesh setting caching will work in that case? This code will not be run currently if a navmesh computed with include_static_objects=False is cached as part of the dataset, right?

@Skylion007
Copy link
Contributor

Thoughts @aclegg3 on having this bool be part of the navmesh settings struct instead? Any reason for or against it?

@Skylion007
Copy link
Contributor

Ah, nvm I see this is part of some legacy code that it is not part of the navmesh setting struct for some reason. @aclegg3 Do you rememebr what the historical reason for not putting it as part of the navmesh settings was?

@aclegg3
Copy link
Contributor

aclegg3 commented May 15, 2023

Ah, nvm I see this is part of some legacy code that it is not part of the navmesh setting struct for some reason. @aclegg3 Do you rememebr what the historical reason for not putting it as part of the navmesh settings was?

Currently, NavMeshSettings only includes recast-level parameters. The mesh joining triggered by this flag happens before the nav module is ever invoked, so it is really a Simaultor flag at the scene level.

I think there could be a valid argument to add this to the NavMeshSettings and then pivot off of that in recompute_navmesh directly instead of treating it separately. That would be a breaking change across the stack. Let's discuss this further before merging this change as-is.

@aclegg3 aclegg3 mentioned this pull request May 17, 2023
11 tasks
@aclegg3
Copy link
Contributor

aclegg3 commented Jun 1, 2023

Superseded by #2111

@aclegg3 aclegg3 closed this Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants